<?php

$method_map = array(
    "" => "index",
    "login" => "login",
    "logout" => "logout"
);

require_once("baseController.php");
require_once('libs/auth_lib.php');
require_once('helpers/url_helper.php');

function index() {
    showView('login', array());
}

function login() {
    global $req;
    addAuth();
    $cpath = $req['callback_path'];
    $cmeth = $req['callback_method'];
    header('Location: '.get_url($cpath,$cmeth,array()));
}

function logout() {
    global $req;
    if (isAuth ())
        removeAuth();
    $cpath = $req['callback_path'];
    $cmeth = $req['callback_method'];
    header('Location: '.get_url($cpath,$cmeth,array()));
}